<?php 
// header("content-type:text/html;charset=utf-8");         //设置编码





function getfiles($dir){

    $filelist = scandir($dir);
    $files=[];
    foreach($filelist as $file) {
        if(is_dir($file)){
            continue;
        }
       $file = iconv('gbk' , 'utf-8' , $file );
        // echo $file;

        array_push($files,$file);

    }

    return $files;
}


$bk = getfiles('./static/img/case/bk');
$zgz = getfiles('./static/img/case/zgz');
// var_dump($bk);
// var_dump($zgz);

?>

<div class="dbcontain" >
    

    <div class=" m0auto tran3" >

        <div class="doubleslogen _active_teriary">
                <p class="chinesetitle">最好的职业教育服务者</p>
                <p class="englishtitle">Best professional education server</p>
        </div>
    </div>
</div>

<div class="dbcontain" >
    <!-- 轮播图 -->
    <div class="limit-width  m0auto tran3 clearfix" >
        <div class="titlediv _active_secondary _bg_secondary dib p15">
            <p class="title fs-lg">本科</p>
            <p class="subtitle">Undergraduate course</p>
        </div>

        <div class="clearfix">
            <div id="bk-swiper" class="swiper-container ">
                <div class="swiper-wrapper">
                   
                       <div class="swiper-slide">
                            <div class="row">
                             <?php foreach ($bk as $key=>$value) { $icons = explode("-",$value);if(count($icons)<4){continue;};?>
                                <div class="col-xs-6">
                                    <div class="caseitem">
                                        <div class="caseimg imgcontain" style="background-image:url('./static/img/case/bk/<?php echo $value; ?>')"></div>
                                        <div class="caseinfo tc _active_secondary">
                                            <p class="chinesename"><?php echo $icons['2']; ?></p>
                                            <p class="englishname"><?php echo preg_replace('/.png|.jpg/', '', $icons['3']); ?></p>
                                        </div>
                                    </div>
                                </div>
                            <?php } ?>

                            </div>
                       </div>
                    
                </div>
                <div class="swiper-pagination "></div>
            </div>
            
        </div>
    </div>
</div>


<div class="line1" style="margin:20px 0;"></div>


<div class="dbcontain " >


    <div class="limit-width m0auto tran3" >
        <div class=" titlediv _active_secondary _bg_secondary dib p15">
            <p class="title fs-lg">中高职</p>
            <p class="subtitle">
            Sencondary vocational schools and 
            advanced vocational schools</p>
        </div>

        <div class=" clearfix">
            <div id="zgz-swiper" class="swiper-container ">
                <div class="swiper-wrapper">
                   
                       <div class="swiper-slide">
                            <div class="row caserow">
                             <?php foreach ($zgz as $key=>$value) { $icons = explode("-",$value);if(count($icons)<4){continue;};?>
                                <div class="col-xs-6">
                                    <div class="caseitem">
                                        <div class="caseimg imgcontain" style="background-image:url('./static/img/case/zgz/<?php echo $value; ?>')"></div>
                                        <div class="caseinfo tc _active_secondary">
                                            <p class="chinesename"><?php echo $icons['2']; ?></p>
                                            <p class="englishname"><?php echo preg_replace('/.png|.jpg/', '', $icons['3']); ?></p>
                                        </div>
                                    </div>
                                </div>
                            <?php } ?>

                            </div>
                       </div>
                    
                </div>
                <div class="swiper-pagination "></div>
            </div>
            
        </div>
    </div>
</div>

<style>

.caserow{
    margin:20px auto;
}

.pc70{
    border-left:2px solid #1a237e;
}
.caseitem{
    margin:20px auto;
    min-height: 180px;
}
.caseitem .caseimg{
    height: 100px;
}
.caseinfo .englishname{
    font-size: 80%;
}

.titlediv{
    box-shadow: 20px 20px 1px rgba(98,109,170,.3);
    /*height: 50px;*/
    width: 240px;
}
.titlediv .subtitle{
    font-size:80%;
}


</style>

<script>
$(document).ready(function(){


    initCaseSwiper('bk');
    initCaseSwiper('zgz');


})

function initCaseSwiper(id){

  var mySwiper = new Swiper ('#'+id+'-swiper', {
        autoplay: 3000,
        loop:true,
        lazyLoading : true,
        watchSlidesVisibility:true,
        observer:true,
        observeParents:true,
        pagination: {
          el: '.swiper-pagination',
          bulletElement : 'li',
          clickable:true
        },
    } ) ;


}

</script>